<!-- 首页 -->
<template>
	<view class="container">
		<view class="sm-border card-menu">
			<view class="cu-item bg-white margin-bottom-sm" v-for="item in list" :key="item.id"
				@click="toStudentAwardsInfo(item)">
				<view class="content padding-sm">
					<view class="flex align-center justify-between">
						<view class="flex align-center">
							<uni-icons type="person" size="15" color="#333"></uni-icons>
							<text class="margin-left-xs text-black">{{item.student_name}}</text>
						</view>
						<view class="flex" v-if="item.check_reward_level_name">
							<uni-icons type="vip-filled" size="15" color="#fbbd08"></uni-icons>
							<text class="fr text-sm text-orange">{{item.check_reward_level_name}}</text>
						</view>
					</view>
					<view class="padding-tb-xs">
						<text class="text-gray text-sm">{{item.match_parent_cate_name}}</text>
						<text class="text-sm">({{item.match_cate_name}})</text>
					</view>
				</view>

			</view>
		</view>
		<u-popup :show="popupShow" mode="center" @close="handlePopupClose">
			<view class="padding-sm">
				<view class="text-orange text-bold text-xl text-center padding-tb-xl"
					v-show="awardsInfo.check_reward_level_name">
					<text>{{awardsInfo.check_reward_level_name}}</text>
				</view>
				<u-cell-group :border="false">
					<u-cell title="姓名" :value="awardsInfo.student_name"></u-cell>
					<u-cell title="证件号" :value="awardsInfo.student_document_nums"></u-cell>
					<u-cell title="参赛编号" :value="awardsInfo.id"></u-cell>
					<u-cell title="赛事名称" :value="awardsInfo.match_type_name">
						<!-- <view class="" slot="value">
							<text>{{awardsInfo.match_type_name}}</text>
						</view> -->
					</u-cell>
					<u-cell title="参赛组别" :value="awardsInfo.match_parent_cate_name"></u-cell>
					<u-cell title="参赛组项" :value="awardsInfo.match_cate_name"></u-cell>
					<u-cell title="参赛区域" :value="awardsInfo.match_area_group_name"></u-cell>

				</u-cell-group>
			</view>
		</u-popup>
		<view class="c-empty" v-if="list.length==0">
			<u-empty icon="/static/empty/list.png" text="暂无学生获奖信息" textSize="18" marginTop="25%" width="80%"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		name: "",
		data() {
			return {
				awardsInfo: {},
				popupShow: false,
				// 获奖列表
				list: [],
				query: {
					page: 1,
					page_size: 20,
					match_type_name: ''
				}
			}
		},
		onLoad(query) {
			this.query.match_type_name = query.name
			this.getList()
		},
		onReachBottom() {
			this.query.page += 1
			this.getList()
		},
		methods: {
			handlePopupClose(){
				this.popupShow = false
			},
			// 获奖信息
			toStudentAwardsInfo(info) {
				// this.popupShow = true
				// this.awardsInfo = val
				if (info) {
					this.navigateTo("/pages/pages_mine/studentAwardsInfo?info=" + encodeURIComponent(JSON.stringify(info)))
				}
			},
			getList() {
				this.$http.getGameGoodList(this.query).then(res => {
					this.list = this.list.concat(res.data)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {}
</style>